import time


class ListManager(object):
    """
    列表管理器
    """

    def __init__(self):
        self.x = []

    def list_add(self, info):
        self.x.append(info)

    def list_delete(self, info, delete_all=False):
        if delete_all:
            for list_info in self.x:
                self.x.remove(list_info)
        else:
            self.x.remove(info)


class ListSorted(object):
    def __init__(self, x, y, z):
        self.x = x
        self.y = y
        self.z = z


if __name__ == '__main__':
    list1 = [ListSorted(1, "a", 1), ListSorted(2, "b", 2), ListSorted(3, "a", 2), ListSorted(4, "b", 1)]
    list1.sort(key=lambda x: (x.z, x.y))
    for i in list1:
        print(i.x)

    # lsit_1 = [0, 1, 2]
    # print(lsit_1)
